package com.yowasa.xiuxian.engine.item.danyao;

import com.yowasa.xiuxian.annoations.Item;
import com.yowasa.xiuxian.engine.item.ItemInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ItemTypeEnum;
import com.yowasa.xiuxian.exception.HandlerException;

@Item(name = "月华露", type = ItemTypeEnum.DAN_YAO, price = 10)
public class YueHuaLu implements ItemInterface {

    @Override
    public String desc() {
        return "回复至多5000点MP，商店可售";
    }

    @Override
    public String effect(UserBO userBO) {
        if (userBO.getUserBattle().getCmp() >= userBO.getUserBattle().getMp()) {
            throw new HandlerException("你体内灵气充足,不需要使用月华露");
        }
        int need = userBO.getUserBattle().getMp() - userBO.getUserBattle().getCmp();
        String exMsg = "";
        if (need < 5000) {
            userBO.getUserBattle().setCmp(userBO.getUserBattle().getMp());
            exMsg = ",你感觉你的灵气已经完全回复了";
        } else {
            userBO.getUserBattle().setCmp(userBO.getUserBattle().getCmp() + 5000);
        }
        return "回复了灵气" + exMsg;

    }


}
